var util = require('../../utils/util.js');
var app = getApp();

Page({
  data: {
    departments: ['支付系统研发部', '管理系统研发部'],
    dindex: 0,
    ternimals:['192.168.0.1四楼东面1','192.168.0.2广东'],
    tindex:0,
    openId: '',
    userInfo: {},
    creating: false,
    button: {
      txt: '提交'
    },
  },

  bindPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value
    })
  },

  // 提交、检验
  bindSubmit: function (e) {
    var that = this;
    var regis = this.data;
    var creating = this.data.creating;

    if (regis.name == '' || regis.address == '点击选择地点') {
      this.setData({
        modalHidden: false
      });
    } else {
      if (!creating) {
        this.setData({
          'creating': true
        });
        that.createTask();
      }
    }
  },

  onShow: function () {
    // 恢复新建按钮状态
    this.setData({
      'creating': false
    });
  },

  onHide: function () {
  },

  // 初始化设置
  onLoad: function () {
    var that = this;
    var now = new Date();
    var openId = wx.getStorageSync('openId');



  }
})